import React from "react"
import ReactDOM from "react-dom/client"
import { BrowserRouter } from "react-router-dom"
import { registerMicroApps, start } from "qiankun"
import "./index.css"
import App from "./App"
registerMicroApps([
  // 项目管理
  {
    name: "pm",
    entry: "//localhost:3010",
    container: "#container",
    activeRule: "/pm-react",
  },
  // 团队协作
  {
    name: "team",
    entry: "//localhost:3020",
    container: "#container",
    activeRule: "/team-react",
  },
  // 文档管理
  {
    name: "dm",
    entry: "//localhost:3030",
    container: "#container",
    activeRule: "/dm-react",
  },
  // 数据分析
  {
    name: "data",
    entry: "//localhost:3040",
    container: "#container",
    activeRule: "/data-vue",
  },
  // 系统管理
  {
    name: "system",
    entry: "//localhost:3050",
    container: "#container",
    activeRule: "/system-vue",
  },
])
// 启动qiankun
start()
const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement)
root.render(
  <BrowserRouter>
    <App />
  </BrowserRouter>
)
